using System;
namespace fuzzyKittenVNC
{
	public interface ISocketObservable {
		void shutdown();	
		
	}
	
	public class SocketStatusObserver : Observer
	{
		public override void update() {
			bool disconnect = false;
			foreach(ObservableSubject o in this.observed) {
				if(!(bool) o.getStatus()) {
					disconnect = true;
					break;
				}
			}
			
			if(disconnect) {
				foreach(ISocketObservable o in this.observed) {
					o.shutdown();
				}
				this.observed = new System.Collections.ArrayList();
			}
		}
	}
}

